{template 'common/header'}
<ul class="we7-page-tab">
	<li {if $do != 'display' && $do != 'view'}class="active"{/if}><a href="{php echo url('system/scan');}">木马查杀</a></li>
	<li {if $do == 'display'}class="active"{/if}><a href="{php echo url('system/scan', array('do' => 'display'));}">查杀报告</a></li>
	{if $do == 'view'}<li class="active"><a href="javascript:;">查看文件</a></li>{/if}
</ul>
{if $do == 'post'}
<div class="clearfix">
	<form action="" method="post" class="form we7-form">

		<div class="form-group">
			<label class="col-sm-2 control-label">操作说明</label>
			<div class="col-sm-10">
				<div class="help-block">这里是说明</div>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">查杀目录</label>
			<div class="col-sm-10" style="">
				{loop $list $index $li}
				<div class="checkbox" style="margin-left:15px">
					{if is_dir($li)}
					<input type="checkbox" name="dir[]" id="dir[{$index}]" value="{$li}"/><label for="dir[{$index}]"><i class="fa fa-folder-open"> </i> {php echo basename($li);}</label>
					{else}
					<input type="checkbox" name="dir[]" id="dir[{$index}]" value="{$li}"/><label for="dir[{$index}]"><i class="fa fa-file-code-o"> </i> {php echo basename($li);}</label>
					{/if}
				</div>
				{/loop}
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">特征函数</label>
			<div class="col-sm-10">
				<input type="text" class="form-control" name="func" value="{$safe['func']}"/>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">特征代码</label>
			<div class="col-sm-10">
				<input type="text" class="form-control" name="code" value="{$safe['code']}"/>
			</div>
		</div>
		
		<input type="submit" name="submit" value="提交" class="btn btn-primary col-lg-1"/>
		<input type="hidden" name="token" value="{$_W['token']}"/>
			
	</form>
</div>
{elseif $do == 'display'}
<div class="clearfix">
			<table class="table we7-table table-hover site-list">
				<col width=""/>
				<col width="115px"/>
				<col width="115px"/>
				<col width="115px"/>
				<col width="105px"/>
				<col width="115px"/>
				<col width="115px"/>
				<col width="115px"/>
				<tr>
					<th>文件地址</th>
					<th>特征函数次数</th>
					<th>特征函数</th>
					<th>特征代码次数</th>
					<th>特征代码</th>
					<th>Zend encoded</th>
					<th>危险文件</th>
					<th class="text-right">操作</th>
				</tr>
				{loop $badfiles $k $v}
					<tr>
						<td class="text-over" style="word-break: break-word;">{$k}</td>
						<td style="word-break: break-word;">{$v['func_count']}</td>
						<td style="word-break: break-word;"><span class="text-danger">{$v['func_str']}</span></td>
						<td style="word-break: break-word;">{$v['code_count']}</td>
						<td style="word-break: break-word;"><span class="text-danger">{$v['code_str']}</span></td>
						<td style="word-break: break-word;">
							{if isset($v['zend'])}
							<span class="label label-danger">Yes</span>
							{else}
							No
							{/if}
						</td>
						<td style="word-break: break-word;">
							{if isset($v['danger'])}
							<span class="label label-danger">Yes</span>
							{else}
							No
							{/if}
						</td>
						<td style="word-break: break-word;">
							<div class="link-group"><a href="{php echo url('system/scan/', array('do' => 'view', 'file' => authcode($k, 'ENCODE')));}" title="查看">查看</a></div>
						</td>
					</tr>
				{/loop}
			</table>
</div>
{elseif $do == 'view'}
<div class="clearfix">
	<div class="panel panel-default">
		<div class="panel-heading">查看文件 <span class="text-danger">[{$file_tmp}]</span></div>
		<div class="panel-body">
			<div style="margin-bottom: 15px">
				{if $info['danger']}
				<span class="label label-primary">危险文件</span>
				{/if}
				{if $info['func_count']}
				<span class="label label-danger">特征函数次数：{$info['func_count']}</span>
				<span class="label label-danger">特征函数：{$info['func_str']}</span>
				{/if}
				{if $info['code_count']}
				<span class="label label-warning">特征代码次数：{$info['code_count']}</span>
				<span class="label label-warning">特征代码：{$info['code_str']}</span>
				{/if}
				{if $info['zend']}
				<span class="label label-info">Zend encoded</span>
				{/if}
			</div>
			<textarea name="" id="" cols="30" rows="20" class="form-control">{$data}</textarea>
		</div>
	</div>
	<form action="" class="form-horizontal">
		<div class="form-group">
			<div class="col-sm-10">
				<a href="{php echo url('system/scan', array('do' => 'display'))}" class="btn btn-primary col-lg-1"/>返回</a>
			</div>
		</div>
	</form>
</div>
{/if}
{template 'common/footer'}
